import { RouteRecordRaw } from 'vue-router'

const Login = () => import('@/views/login/login.vue')
const Home = () => import('@/views/home/home.vue')
const Layout = () => import('@/layout/layout.vue')
const Page404 = () => import('@/views/error/page404.vue')

// 基础路由，不需要设置权限
export const basicRoutes:RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: Login
  }, {
    path: '/',
    name: 'layout',
    component: Layout,
    meta: {
      requiresAuth: true // 在这里设置，表示layout下边的子路由全部需要登录才能访问
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'Home',
        meta: {
          title: '首页'
        },
        component: Home
      }
    ]
  }, {
    path: '/:pathMatch(.*)',
    name: 'page404',
    component: Page404
  }
]
